package com.kexin.jbsg.feiliu;

import android.content.Intent;
import android.os.Bundle;

import com.fl.gamehelper.base.info.ScreenSet;
import com.fl.gamehelper.base.info.UserInfo;
import com.fl.gamehelper.service.UserAccountCallback;
import com.fl.gamehelper.ui.activity.account.LoginActivity;
import com.kexin.jbsg.AbstractUnityActivity;

public class MainActivity extends AbstractUnityActivity implements UserAccountCallback{
	public static MainActivity instance;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //设置横竖屏
        ScreenSet.setIsScreenLandscape(this,true);
        instance = this;
    }
    
    @Override
	protected void initSDKInfo() {
    	debug = false;
		androidTest = false;
	}

	@Override
	public void login() {
		logInfo( "使用飞流 SDK登陆！");
		Intent _intent = new Intent(this, LoginActivity.class);
		this.startActivity(_intent);
	}
	
	public void pay(int userId, int roleId, int serverId, int money,String roleName,int channel){
		logInfo("使用飞流充值");
		Intent it = new Intent(this,PayActivity.class);
		it.putExtra("userId",""+userId);
		it.putExtra("userRoleId",""+roleId);
		it.putExtra("serverId", ""+serverId);
		it.putExtra("roleName",roleName);
		it.putExtra("channel",channel);
		this.startActivity(it);
	}
	
	@Override
	public void pay(int userId, int roleId, int serverId, int money,String roleName) {
		pay( userId,  roleId,  serverId,  money, roleName,-1);
	}
	
	protected void onDestroy() {
		super.onDestroy();
	}

	//飞流登录接口
	@Override
	public void acquireUserInfo(UserInfo arg0, boolean arg1) {
		
	}

	@Override
	public void errorToExit() {
		
	}
	
	
	
	public static void exitGameFL(){
		//System.exit(0);
		instance.finish();
	}
}
